import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('../views/login.vue')
  },
  {
    path: '/register',
    component: () => import('../views/register.vue')
  },
  {
    path: '/admin/home',
    component: () => import('../views/admin/home.vue'),
	children: [
		{
		  path: '/admin/user',
		  component: () => import('../views/admin/user.vue')
		},
		{
		  path: '/admin/video',
		  component: () => import('../views/admin/video.vue')
		},
		{
		  path: '/admin/play',
		  name: 'play',
		  component: () => import('../views/admin/play.vue')
		},
		{
		  path: '/admin/addvideo',
		  component: () => import('../views/admin/addvideo.vue')
		},
		{
		  path: '/admin/adduser',
		  component: () => import('../views/admin/adduser.vue')
		},
		{
		  path: '/admin/carousel',
		  component: () => import('../views/admin/carousel.vue')
		},
		{
		  path: '/admin/addcarousel',
		  component: () => import('../views/admin/addcarousel.vue')
		},
	]
  },
  {
    path: '/user/home',
    component: () => import('../views/user/home.vue'),
	redirect: "/user/video",
	children:[
		{
			path: '/user/video',
			name: 'videolist',
			component: () => import('../views/user/video.vue'),
		},
		{
			path: '/user/collect',
			component: () => import('../views/user/collect.vue'),
		},
	]
  },
  {
    path: '/user/play',
    name: 'userplay',
    component: () => import('../views/user/play.vue')
  },
  
]

const router = new VueRouter({
  routes
})

export default router
